package com.lg.wxq.utils;

import android.util.Log;

public class DebugUtils {
	public static final String TAG="weixinqing";
	public static final String ERROR="error";
	public static final String ISNULL="isnull";
	public static final boolean ISTRACE=true;
	
	public static void debug(String msg){
		if(ISTRACE){
			Log.i(TAG, msg);
		}
	}
	
	private static void error(String msg){
		if(ISTRACE){
			Log.e(ERROR, msg);
		}
	}
	
	public static void exception(Exception e){
		error("异常:");
		error("Caused by:"+e.toString());
		for (StackTraceElement stackTraceElement : e.getStackTrace()) {
			error(stackTraceElement.toString());
		}
	}
	
	public static <T> void isNull(String name,T obj){
		if(ISTRACE){
			if(obj==null){
				Log.i(ISNULL, name+":是空");
			}else{
				Log.i(ISNULL, name+":不是空");
			}
		}
	}
}
